package com.example.controller;

import com.example.common.Result;
import com.example.entity.ClubComment;
import com.example.service.ClubCommentService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/club/comment")
public class ClubCommentController {
    @Resource
    private ClubCommentService clubCommentService;

    @GetMapping("/list/{clubId}")
    public Result list(@PathVariable Integer clubId) {
        List<ClubComment> comments = clubCommentService.selectByClubId(clubId);
        return Result.success(comments);
    }

    @PostMapping("/add")
    public Result add(@RequestBody ClubComment comment) {
        clubCommentService.add(comment);
        return Result.success();
    }
} 